﻿namespace 八
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Lady z = new Lady("张女士", new Cat());
            Lady w = new Lady("王女士", new Dog());
            z.myPetEnjoy();
            w.myPetEnjoy();
        }
    }
    abstract class  Animal
    {
        public string name;
        abstract public void enjoy();

    }
    class Cat:Animal
    {
        string eyesColor;
        public Cat() { eyesColor = "red"; }
        public Cat(string s) { eyesColor = s; }
        public override void enjoy()
        {
            Console.WriteLine("笑一笑");
        }
    }
    class Dog:Animal
    {
        string futColor;
        public Dog() { futColor = "red"; }
        public Dog(string s) { futColor = s; }
        public override void enjoy()
        {
            Console.WriteLine("叫一叫");
        }
    }
    class Lady
    {
        private string name;
        private Animal pet;
        public Lady(string name,Animal pet)
        {
            this.name = name;
            this.pet = pet;
        }
        public void myPetEnjoy()
        {
            Console.Write(name + "she's pet");
            pet.enjoy();
            Console.WriteLine();
        }
    }

}
